import { Renderer3D, RendererMgr, RenderMode } from '@amcax/renderer';
import { ctx2 } from '@app-base/module';

export function renderNoEdge() {
  const render = RendererMgr.getRender<Renderer3D>('3d');
  render.changeRenderMode(RenderMode.NOEDGE);
  ctx2.viewer.sceneSetup.switchToPhongMode();
  return null;
}

export function renderAllEdge() {
  const render = RendererMgr.getRender<Renderer3D>('3d');
  render.changeRenderMode(RenderMode.ALLEDGE);
  ctx2.viewer.sceneSetup.switchToPhongMode();
  return null;
}

export function renderHiddenEdge() {
  const render = RendererMgr.getRender<Renderer3D>('3d');
  render.changeRenderMode(RenderMode.HIDDENEDGE);
  ctx2.viewer.sceneSetup.switchToPhongMode();
  return null;
}

export function renderWireframe() {
  const render = RendererMgr.getRender<Renderer3D>('3d');
  render.changeRenderMode(RenderMode.WIREFRAME);
  ctx2.viewer.sceneSetup.switchToPhongMode();
  return null;
}

export function renderPhysicalMaterial() {
  const render = RendererMgr.getRender<Renderer3D>('3d');
  render.changeRenderMode(RenderMode.PHYSICALMATERIAL);
  ctx2.viewer.sceneSetup.switchToPBRMode();
  return null;
}
